<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../../include/admincontent.jsp" %>
<div id="Content">
    <form id="modelform" method="post" action="/schooluser/AddAction">
        <div class="toolbars text-center">
            <a id="save">
                <em class="ico16 save_traft_16"></em>
                <span class="menu_span" title="保存">保存</span>
            </a>
        </div>
        <table class="treeTable inputform"style="margin-top: 10px">
            <tbody>
            <tr>
                <td width="80">登录账号：</td>
                <td><input type="text" name="ucode" datatype="*" nullmsg="登录账号不能为空！"/></td>
            </tr>
            <tr>
                <td>学校名称：</td>
                <td><input type="text" name="uname" datatype="*" nullmsg="学校名称不能为空！"/></td>
            </tr>
            <tr>
                <td>联系方式：</td>
                <td><input type="text" name="utel"/></td>
            </tr>
            <tr>
                <td>登录密码：</td>
                <td><input type="password" name="upwd" datatype="*" nullmsg="登录密码不能为空！"/></td>
            </tr>
            </tbody>
        </table>
    </form>
</div>
</body>
<script type="text/javascript">
    $(document).ready(function () {
            $("#save").click(function () {
                var data = {};
                data["ucode"] = $("input[name='ucode']").val();
                data["uname"] = $("input[name='uname']").val();
                data["utel"] = $("input[name='utel']").val();
                data["upwd"] = $("input[name='upwd']").val();
                $.ajax({
                    url: "/schooluser/AddAction",
                    type: 'POST',
                    data: data,
                    success: function (data) {
                        layer.msg(data.Message, {icon: 1, time: 2000});
                        setTimeout(()=>{
                            parent.location.reload();
                        }, 2000);

                    },
                    error: function (data) {
                        layer.msg(data.Message, {icon: 2});
                    }
                });
            });
    });
</script>
</html>